<!-- $Id: goods_list author: liuricheng 2014-08-05 -->

<div id="content">	
	<table id="goods-list-table"  class="qs-table" cellpadding="3" cellspacing="1" width="100%">
		<tr class="qs-header">
			<th class="" width="120px">
				<div>
					<input onclick="listTable.selectAll(this, &quot;checkboxes&quot;)"  type="checkbox">
					<a href="javascript:listTable.sort('goods_id');" title="点击对列表排序">编号</a>
					<img src="__PUBLIC__/image/admin/sort_desc.gif" />    
				<div>
			</th>
			<th  width="120px">
				<a href="javascript:listTable.sort('goods_name');">商品名称</a>
			</th>
			<th align="left">
				<a href="javascript:listTable.sort('goods_sn');">货号</a>
			</th>
			<th >
				<a href="javascript:listTable.sort('shop_price');">价格</a>
			</th>
			<th>
				<a href="javascript:listTable.sort('is_on_sale');">上架</a>
			</th>
			<th>
				<a href="javascript:listTable.sort('is_best');">精品</a>
			</th>
			<th>
				<a href="javascript:listTable.sort('is_new');">新品</a>
			</th>
			<th>
				<a href="javascript:listTable.sort('is_hot');">热销</a>
			</th>
			<th>
				<a href="javascript:listTable.sort('sort_order');">推荐排序</a>
			</th>
			<th>					
				<a href="javascript:listTable.sort('goods_number');">库存</a>
			</th>
			<th class="">操作</th>
		</tr>
			<tbody>
			<volist name="goodsList" id="goods" key="k">
			<tr id="tr_{$goods.goods_id}" class="data <if condition="($k % 2) eq '0'">even<else/>odd</if> "> <!-- # odd:奇数;even:偶数 # -->
				<td class="first">
					<input type="checkbox" name="checkboxes[]" value="{$goods.goods_id}">{$goods.goods_id}
				</td>
				<td class="first-cell" >
					<span onclick="listTable.edit(this, 'goods_name', {$goods.goods_id})">{$goods.goods_name}</span>
				</td>
				<td >
					<span onclick="listTable.edit(this, 'goods_sn', {$goods.goods_id})">{$goods.goods_sn}</span>
				</td>
				<td align="right" >
					<span class="c-price" onclick="listTable.edit(this, 'shop_price', {$goods.goods_id})">{$goods.shop_price}</span>
				</td>
				<td  >
					<if condition="$goods['is_on_sale'] eq 1">
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_on_sale', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_yes.gif" />
					<else/>
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_on_sale', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_no.gif" />
					</if>
				</td>
				<td  >
					<if condition="$goods['is_best'] eq 1">
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_best', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_yes.gif" />
					<else/>
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_best', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_no.gif" />
					</if>
				</td>
				<td  >
					<if condition="$goods['is_new'] eq 1">
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_new', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_yes.gif" />
					<else/>
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_new', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_no.gif" />
					</if>
				</td>
				<td  >
					<if condition="$goods['is_hot'] eq 1">
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_hot', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_yes.gif" />
					<else/>
					<img class="pointer" onclick="listTable.changeStatus(this, 'is_hot', {$goods.goods_id});" src="__PUBLIC__/image/admin/bg_no.gif" />
					</if>
				</td>
				<td align="left" >
					<span class="c-sort" onclick="listTable.edit(this, 'sort_order', {$goods.goods_id})">{$goods.sort_order}</span>
				</td>
				<td align="left" >
					<span class="c-store" onclick="listTable.edit(this, 'goods_number', {$goods.goods_id})">{$goods.goods_number}</span>
				</td>
				<td align="left" >
					<!-- [查看商品] -->
					<a href="../goods.php?id={$goods.goods_id}" target="_blank" title="查看">
						<img src="__PUBLIC__/image/admin/icon_view.gif" width="16" height="16" border="0">
					</a>
					<a href="__URL__/mod_goods?goods_id={$goods.goods_id}&extension_code={$goods.extension_code}" title="编辑">
						<img src="__PUBLIC__/image/admin/icon_edit.gif" width="16" height="16" border="0">
					</a>
					<a href="goods.php?act=copy&amp;goods_id={$goods.goods_id}&extension_code={$goods.extension_code}" title="复制">
						<img src="__PUBLIC__/image/admin/icon_copy.gif" width="16" height="16" border="0">
					</a>
					<a href="javascript:;" onclick="listTable.remove({$goods.goods_id}, '您确实要把该商品放入回收站吗？')" title="回收站">
						<img src="__PUBLIC__/image/admin/icon_trash.gif" width="16" height="16" border="0">
					</a>
					<img src="__PUBLIC__/image/admin/icon_docs.gif" width="16" height="16" border="0">          
				</td>
			</tr>
			</volist>
			<tr class="tfoot">
				<td class="first" style="">&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td class="last">&nbsp;</td>
			</tr>
		</tbody>
	</table>
	<include file="Library:paginator"/>
</div>

<script>

	$(document).ready(function(){
		/* 隔行变色 */
		$('#goods-table').tableUI();
		/* Initialize Url */
		listTable.init('__URL__/ajax_goods');				
	});	
	
</script>